﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace D2DEngine.Scene
{
    public class D2DMount : ICloneable
    {
        protected D2DSceneObject sceneObject;

        public D2DSceneObject SceneObject
        {
            get { return this.sceneObject; }
            set { this.sceneObject = value; }
        }

        protected Vector2 position;

        /// <summary>
        /// The position of the mounted object relative
        /// to its parent
        /// </summary>
        public Vector2 Position
        {
            get { return this.position; }
            set { this.position = value; }
        }

        protected float rotation;

        /// <summary>
        /// The rotation of the mounted object
        /// </summary>
        public float Rotation
        {
            get { return this.rotation; }
            set { this.rotation = value; }
        }


        public D2DMount(D2DSceneObject obj, Vector2 position, float rotation)
        {
            this.sceneObject = obj;
            this.position = position;
            this.rotation = rotation;
        }

        public D2DMount()
        {
        }




        #region ICloneable Members

        public object Clone()
        {
            D2DMount mount = new D2DMount();
         
            mount.Position = this.position;
            mount.rotation = this.rotation;
            mount.sceneObject = (D2DSceneObject)this.sceneObject.Clone();
           
            return mount;
        }

        #endregion
    }
}
